package com.chenl.provider.DEMOS.日志相关.全链路日志以及Spring线程池装饰器的使用;

public class UserThreadLocal {

    private static final ThreadLocal<String> USER_THREAD_LOCAL = new ThreadLocal<>();

    /**
     * 设置当前线程中的用户
     * @param wmUser
     */
    public static void setUser(String wmUser){
        USER_THREAD_LOCAL.set(wmUser);
    }

    /**
     * 获取当前线程中的用户
     * @return
     */
    public static String getUser(){
        return USER_THREAD_LOCAL.get();
    }
}